﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using System.Web.SessionState;
using System.Web.Routing;

namespace EzDesk.ServiceHost
{
    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Feeds", // Route name
                "Feeds/{startIndex}/{count}/{type}", // URL with parameters
                new { controller = "Core", action = "AllJsonFeedsByCount", startIndex = 0, count = 10, type="JSON" } // Parameter defaults
            );

            routes.MapRoute(
                "Login", // Route name
                "Login", // URL with parameters
                new { controller = "Login", action = "Login" } // Parameter defaults
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }
    }
}